package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	gpb "gitee.com/cloudapex/protos/crm_base/pb"
	"google.golang.org/grpc"
)

var Channel channel

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_CRM_BASE, func(c *grpc.ClientConn) {
		Channel.cli = gpb.NewChannelWaySerClient(c)
	})
}

type channel struct {
	cli gpb.ChannelWaySerClient
}

func (this *channel) GetChannelList(ctx context.Context, in *gpb.ChanLiReq) (*gpb.ChanLiRes, error) {
	return this.cli.GetChannelList(ctx, in)
}
func (this *channel) GetProWayList(ctx context.Context, in *gpb.WayLiReq) (*gpb.WayLiRes, error) {
	return this.cli.GetProWayList(ctx, in)
}
